using Boo.Lang;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityScript.Lang;

[Serializable]
public class regionalselect : MonoBehaviour
{
	[Serializable]
	[CompilerGenerated]
	internal sealed class _0024find_0024436 : GenericGenerator<WaitForSeconds>
	{
		internal regionalselect _0024self__0024438;

		public _0024find_0024436(regionalselect self_)
		{
			_0024self__0024438 = self_;
		}

		public override IEnumerator<WaitForSeconds> GetEnumerator()
		{
			return new _0024(_0024self__0024438);
		}
	}

	public RaycastHit hit;

	public regionaltournament rt;

	public career13d nb;

	public AudioClip clip;

	public Camera mainCamera;

	public Transform[] tops;

	private int top;

	public void Start()
	{
		StartCoroutine(find());
		nb.canload = false;
	}

	public void Update()
	{
		if (!Input.GetMouseButtonDown(0))
		{
			return;
		}
		RaycastHit hitInfo = default(RaycastHit);
		if (Physics.Raycast(mainCamera.ScreenPointToRay(UnityEngine.Input.mousePosition), out hitInfo, 100f))
		{
			if (hitInfo.collider.name == "bey2")
			{
				rt.opponent = "bey2";
				nb.canload = true;
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				top = 0;
			}
			else if (hitInfo.collider.name == "bey3")
			{
				rt.opponent = "bey3";
				nb.canload = true;
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				top = 1;
			}
			else if (hitInfo.collider.name == "bey4")
			{
				rt.opponent = "bey4";
				nb.canload = true;
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				top = 2;
			}
			else if (hitInfo.collider.name == "bey5")
			{
				rt.opponent = "bey5";
				nb.canload = true;
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				top = 3;
			}
			else if (hitInfo.collider.name == "bey6")
			{
				rt.opponent = "bey6";
				nb.canload = true;
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				top = 4;
			}
			else if (hitInfo.collider.name == "bey7")
			{
				rt.opponent = "bey7";
				nb.canload = true;
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				top = 5;
			}
			else if (hitInfo.collider.name == "bey8")
			{
				rt.opponent = "bey8";
				nb.canload = true;
				AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
				top = 6;
			}
			Animate();
		}
	}

	public void Animate()
	{
		for (int i = 0; i < Extensions.get_length((System.Array)tops); i++)
		{
			Vector3 position = tops[i].position;
			float x = position.x;
			Vector3 position2 = tops[i].position;
			Vector3 to = new Vector3(x, 0.1f, position2.z);
			if (i == top)
			{
				Vector3 position3 = tops[i].position;
				float x2 = position3.x;
				Vector3 position4 = tops[i].position;
				to = new Vector3(x2, 0.2f, position4.z);
			}
			LeanTween.move(tops[i].gameObject, to, 0.4f).setEase(LeanTweenType.easeOutSine);
		}
	}

	public IEnumerator find()
	{
		return new _0024find_0024436(this).GetEnumerator();
	}

	public void Main()
	{
	}
}
